﻿@model UI.ViewModels.EmployerModel

@{
    ViewBag.Title = Internationalization.Resources.CreateEmployer;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Internationalization.Resources.CreateEmployer</h2>
<p>
    @Internationalization.Resources.CreateAccountInfo @Html.ActionLink(Internationalization.Resources.SignIn, "LogIn").
</p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>@Internationalization.Resources.EmployerInfo</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CountryID)
        </div>
        <div class="editor-field">
            @Html.DropDownList("CountryName")
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CompanyName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CompanyName)
            @Html.ValidationMessageFor(model => model.CompanyName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PassWord)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PassWord)
            @Html.ValidationMessageFor(model => model.PassWord)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.RetypePassword)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.RetypePassword)
            @Html.ValidationMessageFor(model => model.RetypePassword)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.How)
        </div>
        <div class="editor-field">
            @Html.DropDownList("HowHear")
        </div>

        <p>
            <input type="submit" value="@Internationalization.Resources.Continue" />
        </p>
    </fieldset>
}
<script type="text/javascript">
    $("#UserName").blur(function () {
        var UserName = $("#UserName").val();

        if (UserName != '') {
            $.post(
                "CheckUser",
                { "UserName": UserName },
                function (json) {
                    var data = json.data;
                    if (parseInt(data) == 1) {
                        $("#UserName + span").text(json.value).css({ color: "#ff0000" }).show();
                    }
                }
            );
        }
    });
</script>